\section{network::blank\_\-filetype Class Reference}
\label{classnetwork_1_1blank__filetype}\index{network::blank_filetype@{network::blank\_\-filetype}}
This class implements all operations for the \doxyref{blank\_\-filetype}{p.}{classnetwork_1_1blank__filetype}.  


{\tt \#include $<$blank\_\-filetype.h$>$}

Inheritance diagram for network::blank\_\-filetype::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classnetwork_1_1blank__filetype}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{blank\_\-filetype} ()\label{classnetwork_1_1blank__filetype_5ad15316f862eeebf95654af669619f8}

\item 
virtual \bf{$\sim$blank\_\-filetype} ()\label{classnetwork_1_1blank__filetype_fb2b84aad3ff6a35b46bd5f4ac86a1d4}

\item 
virtual boost::shared\_\-ptr$<$ \bf{model::dom} $>$ \bf{parse} (const string \&msg)
\begin{CompactList}\small\item\em parse parses a string into a dom-structure \item\end{CompactList}\item 
void \bf{add\_\-dom} (boost::shared\_\-ptr$<$ \bf{model::dom} $>$ d)
\begin{CompactList}\small\item\em add\_\-dom is called by a callback. \item\end{CompactList}\item 
virtual string \bf{send} (boost::shared\_\-ptr$<$ \bf{model::dom} $>$ dom)
\begin{CompactList}\small\item\em send converts a dom-structure to the blank\_\-filetype-format. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class implements all operations for the \doxyref{blank\_\-filetype}{p.}{classnetwork_1_1blank__filetype}. 

The \doxyref{blank\_\-filetype}{p.}{classnetwork_1_1blank__filetype} is a very simple filetype, which is used by rs\_\-sockets to communicate with the microcontroller. 



Definition at line 48 of file blank\_\-filetype.h.

\subsection{Member Function Documentation}
\index{network::blank_filetype@{network::blank\_\-filetype}!add_dom@{add\_\-dom}}
\index{add_dom@{add\_\-dom}!network::blank_filetype@{network::blank\_\-filetype}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void network::blank\_\-filetype::add\_\-dom (boost::shared\_\-ptr$<$ \bf{model::dom} $>$ {\em d})}\label{classnetwork_1_1blank__filetype_b83f62be8ad6bb0c4dd26eef7556f848}


add\_\-dom is called by a callback. 

add\_\-dom is called by a callback-function to add a dom-node to the internal dom-structure, which is later returned from the parse-function.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em d}]is the dom-node which should be added to the internal dom-structure. \end{description}
\end{Desc}


Definition at line 60 of file blank\_\-filetype.cpp.

\begin{Code}\begin{verbatim}61 {
62         if(_dom.get() == 0) {
63                 _dom.reset(new model::dom(*d));
64         } else {
65                 _dom->insert_node(*d);
66         }
67 }
\end{verbatim}\end{Code}


\index{network::blank_filetype@{network::blank\_\-filetype}!parse@{parse}}
\index{parse@{parse}!network::blank_filetype@{network::blank\_\-filetype}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}boost::shared\_\-ptr$<$ \bf{model::dom} $>$ network::blank\_\-filetype::parse (const string \& {\em msg})\hspace{0.3cm}{\tt  [virtual]}}\label{classnetwork_1_1blank__filetype_1c0b167c7c27d8f79bcb9e63a6b1d962}


parse parses a string into a dom-structure 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em msg}]is the string, which might be received from a socket\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a shared\_\-ptr to a dom-structure is returned. \end{Desc}


Implements \bf{network::parser} \doxyref{p.}{classnetwork_1_1parser_909e81aa801a156145f06939faf5e706}.

Definition at line 32 of file blank\_\-filetype.cpp.

\begin{Code}\begin{verbatim}33 {
34         boost::mutex::scoped_lock l(_mutex);
35         _dom.reset();
36         /*
37         for(int i = 0; i < msg.size(); ++i) {
38                 parse_add(_pars, msg[i]);
39                 ::parse(_pars);
40         }
41         */
42         stringstream stream(msg);
43         string line;
44         getline(stream, line);
45         line += " \n";
46         if(stream.good()) {
47                 for(int i = 0; i < line.size(); ++i) {
48                         parse_add(_pars, line[i]);
49                 }
50 		::parse(_pars);
51                 getline(stream, line);
52         }
53         if(_dom.get() == 0) {
54                 throw network::parse_exception(
55                         "parse_exception in blank_filetype");
56         }
57         return _dom;
58 }
\end{verbatim}\end{Code}


\index{network::blank_filetype@{network::blank\_\-filetype}!send@{send}}
\index{send@{send}!network::blank_filetype@{network::blank\_\-filetype}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string network::blank\_\-filetype::send (boost::shared\_\-ptr$<$ \bf{model::dom} $>$ {\em dom})\hspace{0.3cm}{\tt  [virtual]}}\label{classnetwork_1_1blank__filetype_56ce7cbd0412cdb8c400d1a1785e50fd}


send converts a dom-structure to the blank\_\-filetype-format. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dom}]is the dom-node which should be converted.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a string, formatted with the blank\_\-filetype-format, is returned. This string can be send over a socket. \end{Desc}


Implements \bf{network::sender} \doxyref{p.}{classnetwork_1_1sender_5d3ef325b6ff8ff08a9e2a0b25f4a8bd}.

Definition at line 69 of file blank\_\-filetype.cpp.

\begin{Code}\begin{verbatim}70 {
71         string tag;
72         boost::shared_ptr<model::dom> tmp(dom);
73         while(tmp->name() != "") {
74                 tag += decode_dom(tmp);
75                 tmp = tmp->next_tag();
76         }
77         return tag;
78 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
network/blank\_\-filetype.h\item 
network/blank\_\-filetype.cpp\end{CompactItemize}
